pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let mut flag = false;
    let mut from_base = 0;
    let mut num = 0;
    let mut pow = 0;

    // 实现进制转换
    for item in num_str.chars().rev() {
        if item == ')' {
            flag = true;
            continue;
        }

        if item == '(' {
            pow = 0;
            flag = false;
            continue;
        }

        if flag {
            from_base += (item.to_string().parse::<i32>().unwrap()) * 10_i32.pow(pow);
            pow += 1;
        } else {
            num += (item.to_string().parse::<i32>().unwrap()) * from_base.pow(pow);
            pow += 1;
        }
    }

    let mut target = num;
    let to_base = to_base as i32;
    let mut result = Vec::new();

    while target > 0 {
        let remainder = match target % to_base {
            10 => 'a',
            11 => 'b',
            12 => 'c',
            13 => 'd',
            14 => 'e',
            15 => 'f',
            v => std::char::from_digit(v as u32, 10).unwrap(),
        };
        target = target / to_base;
        result.push(remainder);
    }
    format!("{}", result.iter().rev().collect::<String>())
}
